Parent.prototype.say=function(){
    console.log('hello');
}
function Parent() {
    this.name = 'parent'
    this.like=['a','b','c']
}

function Child() {
    this.age=18
    Parent.call(this)//将Parent内的this指向Child里面的this
}
// 组合继承
Child.prototype=new Parent()
Child.prototype.constructor=Child//修复指向

const c=new Child()
c.like.push('d')
const d=new Child()
console.log(c);
console.log(d);
c.say()//可以访问


